package com.xbongbong.saas.domain.dao.competitor;

import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.saas.domain.entity.ProductUserEntity;
import com.xbongbong.saas.domain.entity.competitor.CompetitorUserEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author Dell
 * @version v1.0
 * @date 2022/8/10 15:33
 * @since v1.0
 */
@Repository
@Mapper
public interface CompetitorUserDao {

    /**
     * 插入数据
     * @param competitorUser
     * @return
     */
    Integer insert(CompetitorUserEntity competitorUser);


    /**
     * 删除数据
     * @param id
     * @param corpid
     * @return
     */
    Integer deleteByKey(@Param("id") Long id,@Param("corpid") String corpid);

    /**
     * 修改数据
     * @param competitorUser
     * @return
     */
    Integer update(CompetitorUserEntity competitorUser);

    /**
     * 查询数据
     * @param id
     * @param corpid
     * @return
     */
    CompetitorUserEntity getByKey(@Param("id") Long id,@Param("corpid") String corpid);

    List<CompetitorUserEntity> findEntities(@Param("param") Map<String, Object> param);

    Integer getEntitysCount(@Param("param") Map<String, Object> param);

    List<CompetitorUserEntity> findBaseEntitys(@Param("param") Map<String,Object> map);

    /**
     *
     * date: 2022/8/18 4:18 下午
     * @author yingjf
     * @param insetBatchList:
     */
    void insertBatch(@Param("list") List<CompetitorUserEntity> insetBatchList);

    /**
     * 批量删除
     * @param corpid 公司id
     * @param delIdList idList
     */
    void deleteBatch(@Param("corpid")String corpid, @Param("delIdList")List<Long> delIdList) throws XbbException;
}
